<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link rel="stylesheet" href="	https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
    <style>
        .account {
            width: 400px;
            margin: 0 auto;
        }
    </style>
    <script src="{% static 'jquery/jquery-3.7.1.min.js' %}"></script>
    <script src="{% static 'js/register.js' %}"></script>
</head>
<body>
<div class="account">
    <h1>注册</h1>
    <form>
        {% for field in form %}
            {% if field.name == 'code' %}
                <div class="mt-3">
                <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                <label style="color: white">验证码</label>
                <div class="input-group mb-3">
                    <input type="text" class="form-control" name="captcha" placeholder="验证码"
                           aria-label="Recipient's username" aria-describedby="button-addon2">
                    <button class="btn btn-outline-secondary" type="button" id="captcha-btn">获取验证码</button>
                </div>
            {% elif field.name == 'email' %}
                <div class="mb-3">
                <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                <input type="email" name="email" class="form-control" placeholder="邮箱">

            {% else %}
                <div class="mb-3 ">
                    <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                    {{ field }}
                </div>
            {% endif %}

        {% endfor %}
        <button type="submit" class="btn btn-primary">注 册</button>

        </div>


    </form>
</body>
</html>